package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.domain.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户基础信息Mapper接口
 */
@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    //1.根据userid查询黑名单的id
    //2.根据黑名单的id得到userInfo数据
    @Select("SELECT * FROM tb_user_info WHERE id in " +
            "(SELECT black_user_id from tb_black_list WHERE user_id=#{userId}) ")
    IPage<UserInfo> findBlackList(@Param("page1") Page page1, @Param("userId") Long userId);
}